#include "Base.h"
#include "LWProtocol.h"


BOOL LWUserLoginMsg::Read( CSocketStream& iStream )
{
	iStream.Read((char*)&m_dwUserId, sizeof(m_dwUserId));
	return TRUE;
}

BOOL LWUserLoginMsg::Write( CSocketStream& oStream ) const
{
	oStream.Write((char*)&m_dwUserId, sizeof(m_dwUserId));
	return TRUE;
}

BOOL WLUserSignupInfoMsg::Read( CSocketStream& iStream )
{ 
	iStream.Read((char*)&m_dwUserId, sizeof(m_dwUserId));
	int nCount;
	iStream.Read((char*)&nCount, sizeof(nCount));
	for(int i = 0; i < nCount; i++)
	{
		UserSignupInfo info;
	    iStream.Read((char*)&info, sizeof(info));	
		m_listSignupInfo.AddTail(info);
	}
	return TRUE;

}

BOOL WLUserSignupInfoMsg::Write( CSocketStream& oStream ) const
{
	oStream.Write((char*)&m_dwUserId, sizeof(m_dwUserId));
	int nCount = m_listSignupInfo.GetCount();
	oStream.Write((char*)&nCount, sizeof(nCount));
	for(int i = 0; i < nCount; i++)
	{
		UserSignupInfo &info = m_listSignupInfo.GetAt(i);
		oStream.Write((char*)&info, sizeof(info));	
	}
	return TRUE;
}